﻿using System.Windows;
using System.Windows.Media;

#nullable enable

namespace Bcmm.Chart.Controls
{
    /// <summary>
    /// 示波器线条。
    /// </summary>
    public class Line
    {
        /// <summary>
        /// 画笔。
        /// </summary>
        public Pen? Pen { get; set; }

        /// <summary>
        /// 起始点。
        /// </summary>
        public Point? StartPoint { get; set; }

        /// <summary>
        /// 结束点。
        /// </summary>
        public Point? EndPoint { get; set; }

        /// <summary>
        /// 绘制线条（仅仅做绘制指令收集，渲染由UI线程进行渲染）。
        /// </summary>
        /// <param name="drawingContext"></param>
        public void Render(DrawingContext drawingContext)
        {
            if (StartPoint is null || EndPoint is null || Pen is null)
            {
                return;
            }

            drawingContext.DrawLine(Pen, (Point)StartPoint, (Point)EndPoint);
        }
    }

    public enum LineType
    {
        /// <summary>
        /// 三次贝塞尔曲线。
        /// </summary>
        Bessel,

        /// <summary>
        /// 直线。
        /// </summary>
        Line
    }

}
